<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button>点击发送 AJAX 请求</button>
  <button id="copyButton" data-url="https://cdn.bootcdn.net/ajax/libs/react/18.2.0/cjs/react-jsx-dev-runtime.development.js">Copy Content</button>

  <script>
    const copyButton = document.querySelector('#copyButton')
    const copyContent = document.querySelector('#copyContent')

    copyButton.addEventListener('click', () => {
      navigator.clipboard.writeText(copyButton.dataset.url);
    });
  </script>
</body>

</html>